package com.aaa.service.impl;


import com.aaa.dao.GoodsDao;
import com.aaa.dto.GoodsCountDto;
import com.aaa.pojo.DefaultMsg;
import com.aaa.pojo.Goods;
import com.aaa.service.GoodsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
@Transactional
public class GoodsServiceImpl extends ServiceImpl<GoodsDao, Goods> implements GoodsService {

    @Resource
    private GoodsDao goodsDao;

    @Override
    public List<Goods> listAllState(String keyword, String name) {
        List<Goods> i= goodsDao.listAllState(keyword,name);
        return i;
    }

    @Override
    public Goods listAllById(Integer id) {
        return goodsDao.listAllById(id);
    }

    @Override
    public List<GoodsCountDto> findGoodsCountByGoodsId(Map<String,List<Integer>> goodsIdList) {
        return goodsDao.findGoodsCountByGoodsId(goodsIdList);
    }
}

